1. Field of the Invention
The present invention relates to an image processing method and apparatus for compressing the dynamic range of an image by changing the gain of the image. The invention also relates to a computer readable recording medium on which is recorded a program for causing a computer to perform the image processing method.
2. Description of the Related Art
Reproduction of images after performing appropriate image processing is common practice in various fields. For example, a dynamic range compression method is proposed. The method generates a low frequency image of an image and reduces the contrast of a high luminance region, a low luminance region, or the entire image such that the difference between the maximum luminance value and minimum luminance value, i.e., dynamic range is reduced using the low frequency image. More specifically, a low frequency image of an image is generated, then a gain is calculated from the low frequency image such that the darker (i.e., the lower the luminance value) the low frequency image the higher the gain, and the calculated gain is added to each pixel or each pixel is multiplied by the gain.
The dynamic range compression allows for making a bright region of an image darker and a dark region of the image brighter. Thus, for example, a high contrast image of a person taken against light can be turned into a high quality image by correcting halation in the background and dark collapsed person's face.
In the dynamic range compression method described above, however, artifacts, such as overshooting, undershooting, and the like occur adjacent to an edge on an image, which cause a problem of image quality degradation. Consequently, methods for preventing such artifacts are proposed as described, for example, in Japanese Unexamined Patent Publication No. 10 (1998)-075364 (Patent Document 1) and Japanese Unexamined Patent Publication No. 5 (1993)-300376 (Patent Document 2). The method described in Patent Document 1 compresses the dynamic range of an image by generating a plurality of band-limited image signals of different frequency bands from an image signal representing the image, generating a cumulative signal by integrating the band-limited image signals in which some of them are reduced before integrated, converting a differential signal obtained by subtracting the cumulative signal from the image signal of the original image by a predetermined function, and adding the signal obtained by the conversion to the original image. The method described in Patent Document 2 is a method that calculates a correction value for dynamic range compression by making comparison in magnitude of pixel value between an image and a low frequency image thereof.
The method described in Patent Document 1, however, is not able to completely eliminate overshooting or undershooting adjacent to an edge included in an image, since the dynamic range compression is performed based on frequency separation of the image. The method described in Patent Document 2 may cause a processed image to be discontinuous at a position where the correction value is changed, since the correction value is calculated based on the magnitude of pixel value between an image and a low frequency image thereof.
The present invention has been developed in view of the circumstances described above, and it is an object of the present invention to improve image quality of a dynamic range compressed image.